<?
/**
 *      woo.vn - mr.Trieu
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: autoupdate.php 15:52:00 - 02-11-2011
 */

if(! defined('IN_DISCUZ')){
	exit('Access Denied');
}

if (! empty($uid)){

	require_once libfile('function/feed');

	$friend = '';
	$feedlist = array();
	$hotstarttime = $_G['timestamp'] - $_G['setting']['feedhotday'] * 3600 * 24;

	$query = DB::query("SELECT *
						FROM " . DB::table('home_friend') . "
						WHERE uid='$uid'");
	while($value = DB::fetch($query)){
		$friend = $value['fuid'];
	}

	if (! empty($friend)){
			$query = DB::query("SELECT *
							FROM " . DB::table('home_feed') . "
							WHERE uid IN ('$friend')
							ORDER BY dateline DESC
							LIMIT 0,10");
	/*WHERE dateline>='$hotstarttime' AND uid = '$uid'*/
		while($feed = DB::fetch($query)){
			$feed = mkfeed($feed);
			$feedlist[$feed['feedid']] = $feed;
		}
	}

}

include_once template("diy:ajax/ajax_feed");